export interface PluginDTO {
  id: string
  name: string
  type: string
  enabled: boolean
  tags: string[]
  pinned: boolean
  info: Info
  dependencies?: Dependencies
  latestVersion: string
  hasUpdate: boolean
  defaultNavUrl: string
  category: string
  signature: SignatureStatus
  signatureType: SignatureType
  signatureOrg: string
  readme?: string
  changelog?: string
  versions?: PluginVersion[]
}

export type SignatureStatus = 'internal' | 'valid' | 'invalid' | 'modified' | 'unsigned'

export type SignatureType = 'caipu' | 'commercial' | 'community' | 'private' | 'private-glob'

export interface BuildInfo {
  time?: number
  repo?: string
  branch?: string
  hash?: string
}

export interface Info {
  author: InfoLink
  description: string
  links: InfoLink[]
  logos: Logos
  build: BuildInfo
  screenshots: Screenshots[]
  version: string
  updated: string
}

export interface InfoLink {
  name: string
  url: string
}

export interface Logos {
  small: string
  large: string
}

export interface Screenshots {
  name: string
  path: string
}

export interface StaticRoute {
  pluginID: string
  directory: string
}

export interface Dependencies {
  caiPuDependency: string
  caiPuVersion: string
  plugins: Dependency[]
}

export interface Dependency {
  id: string
  type: string
  name: string
  version: string
}

export interface PluginVersion {
  version: string
  createdAt: string
  isLatest: boolean
}
